package com.itcam.interview.pro00.disignmodel.proxy.daynatic_;

import java.lang.reflect.Proxy;

// 测试类
public class DynamicProxyExample {
    public static void main(String[] args) {
        RealSubject realSubject = new RealSubject();
        DynamicProxyHandler handler = new DynamicProxyHandler(realSubject);
        Subject proxySubject = (Subject) Proxy.newProxyInstance(
                Subject.class.getClassLoader(),
                new Class<?>[]{Subject.class},
                handler
        );
        proxySubject.request();
    }
}